<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>js中运算符的使用</title>
</head>
<body>

<script type="text/javascript">
    /*
    * js中的运算符
    * 分类：
    *   1. 数学运算   +   -  *  /  %
    *   2. 逻辑运算
    *       &&    and  短路与
    *       ||    or   短路或
    *       !     not
    *   3. 比较运算
    *      >  <  >=  <=  !=  ==  ===  !==
    *   4.赋值运算
    * */

    var num1 = 1
    var num2 = 2

    var result = num1 + num2
    console.log(result)

    result = num1 - num2
    console.log(result)

    result = num1 * num2
    console.log(result)

    result = num1 / num2   //  1/2  0
    console.log(result)

    result = num1 % num2
    console.log(result)

    var b1 = true
    var b2 = false

    //  两边true  提升运算效率    true  &&   false / true
    result = b1 && b2
    console.log(result)

    //  true  ||   false / true
    result = b1 || b2
    console.log(result)

    result  = ! b1
    console.log(result)



</script>
</body>
</html>